import React, { Component } from 'react'
import {NavLink} from 'react-router-dom'
export default class GoodsList extends Component {
  constructor() {
    super();
    this.state = {
      goodsList: [
        {name: 'apple'},
        {name: 'banana'},
        {name: 'pear'}
      ]
    }
  }
  render() {
    return (
      <div>
        {
          this.state.goodsList.map(item => {
            return (
              <div key={item.name}>
                <NavLink to={'/goodsdetail/'+item.name+'?age=18&sex=nv'}>{item.name}</NavLink>
                <br />
                <br />
              </div>
            )
          })
        }
      </div>
    )
  }
}
